package com.APISecond.TrationalDate;

import java.util.Calendar;
import java.util.Date;

public class Calendar_ {
    public static void main(String[] args) {
        //1.得到此刻时间对应的日历对象
        Calendar now=Calendar.getInstance();
        System.out.println(now);
        //2.获取日历中的某个信息
        int year=now.get(Calendar.YEAR);
        System.out.println(year);
        int days=now.get(Calendar.DAY_OF_YEAR);
        System.out.println(days);
        //3.拿到日历中记录的日期对象
        Date d=now.getTime();
        System.out.println(d);
        //4.拿到时间毫秒值
        long time=now.getTimeInMillis();
        System.out.println(time);
        //5.修改日历中的某个信息
        now.set(Calendar.MONTH,9);
        now.set(Calendar.DAY_OF_YEAR,331);
        System.out.println(now);
        //6.为某个信息增加后减少多少
        now.add(Calendar.DAY_OF_YEAR,100);
        //一年过了的时间加100；


    }
}
